{include file="public/header" /}
<link rel="stylesheet" href="/static/index/css/page/setting.css">
<body>
<div class="build-navbar" data-title="{$title}"></div>
<div class="main">

    <form class="layui-form" action="{:url('user/method_save')}" lay-filter="lay-form">
        <div class="vss m-30">
            <input type="hidden" name="type" value="{$type}"/>
            {if $type != 'bank'}
            <div class="item flex items-center justify-between p-30">
                <div class="left flex items-center justify-center">
                    <span class="text">真实姓名</span>
                </div>
                <div class="right">
                    <input type="text" name="name" placeholder="请填写真实姓名" autocomplete="off"
                           lay-verify="req" value="<?php echo $user[$type . '_name']?>"/>

                </div>
            </div>
            <div class="item flex items-center justify-between p-30">
                <div class="left flex items-center justify-center">
                    <span class="text">收款码</span>
                </div>
                <div class="right">
                    <div class="build-uploads"
                         data-url="{:url('uploads/uploadImage')}"
                         data-name="image"
                         data-accept="images"
                         data-def="{$user[$type . '_image']}"
                         data-max="1"
                    ></div>
                </div>
            </div>
            {else}

            <div class="item flex items-center justify-between p-30">
                <div class="left flex items-center justify-center">
                    <span class="text">银行名称</span>
                </div>
                <div class="right flex items-center" lay-click="bank_name">
                    <div class="text flex items-center" style="color: var(--dcl)">{$user.bank_name?:'请选择银行'}</div>
                    <i class="layui-icon layui-icon-right"></i>
                </div>
                <input type="hidden" name="bank_name" value="{$user.bank_name}" class="bank_name"  placeholder="请选择银行" lay-verify="req"/>
            </div>

            <div class="item flex items-center justify-between p-30">
                <div class="left flex items-center justify-center">
                    <span class="text">开户行</span>
                </div>
                <div class="right">
                    <input type="text" name="bank_open" value="{$user.bank_open}" placeholder="请填写开户行"
                           autocomplete="off"
                           lay-verify="req"/>
                </div>
            </div>

            <div class="item flex items-center justify-between p-30">
                <div class="left flex items-center justify-center">
                    <span class="text">银行户名</span>
                </div>
                <div class="right">
                    <input type="text" name="bank_account_name" value="{$user.bank_account_name}"
                           placeholder="请填写银行户名" autocomplete="off"
                           lay-verify="req"/>
                </div>
            </div>

            <div class="item flex items-center justify-between p-30">
                <div class="left flex items-center justify-center">
                    <span class="text">银行卡号</span>
                </div>
                <div class="right">
                    <input type="text" name="bank_number" value="{$user.bank_number}" placeholder="请填写银行卡号"
                           autocomplete="off"
                           lay-verify="req"/>
                </div>
            </div>

            {/if}
        </div>
        <div class="btn theme-btn radius-20 fixed-btn b-30" lay-event="formSubmit">保存</div>
    </form>
</div>

</body>
{include file="public/footer"/}
<script>
    layui.extend({picker: "{/}/static/index/js/core/picker"}).use(['picker', 'methods', 'listen'], function (d) {
        var a = layui.jquery, picker = layui.picker, m = layui.methods;
        m.event.click('bank_name', function (data, that) {
            picker.render(JSON.parse('<?php echo json_encode($bank_list);?>'), function (d) {
                that.children('.text').html(d.title);
                a('.bank_name').val(d.title);
            });
        });

    });
</script>
</html>